package com.weijianhuawen.wjblog.web.controller;

import com.weijianhuawen.wjblog.common.aspect.ApiOperationLog;
import com.weijianhuawen.wjblog.common.utils.PageResponse;
import com.weijianhuawen.wjblog.web.mode.vo.search.SearchArticlePageListReqVo;
import com.weijianhuawen.wjblog.web.service.SearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version: java version 8
 * @Author: weijianhuawen
 * @description:
 * @date: 2024-11-05 14:39
 */
@RestController
@RequestMapping("/search")
@Api(tags = "搜索模块")
public class SearchController {
    @Autowired
    private SearchService searchService;
    @PostMapping("/article")
    @ApiOperation(value = "关键字查询文章")
    @ApiOperationLog(description = "通过关键字分页查询文章信息 基于lucene")
    public PageResponse searchArticlePageList(@RequestBody @Validated SearchArticlePageListReqVo vo) {
        return searchService.searchArticlePageList(vo);
    }
}
